package com.ep.modules.app.controller;

import com.ep.common.annotation.SysLog;
import com.ep.common.utils.PageUtils;
import com.ep.common.utils.R;
import com.ep.common.validator.ValidatorUtils;
import com.ep.modules.app.entity.AppUserLoginVerification;
import com.ep.modules.app.service.AppUserLoginVerificationService;
import java.util.Map;
import org.springframework.beans.factory.annotation.*;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/app/user_login_verification")
public class AppUserLoginVerificationController {
    @Autowired
    private AppUserLoginVerificationService appUserLoginVerificationService;

    @GetMapping("/list")
    public R list(Map<String, Object> params) {
        PageUtils page = appUserLoginVerificationService.queryPage(params);
        return R.ok().put("page", page);
    }

    @GetMapping("/info/{id}")
    public R info(@PathVariable Long id) {
        AppUserLoginVerification appuserloginverification = appUserLoginVerificationService.getById(id);
        return R.ok().put("appuserloginverification", appuserloginverification);
    }

    @SysLog("保存AppUserLoginVerification")
    @PostMapping("/save")
    public R save(@RequestBody AppUserLoginVerification appuserloginverification) {
        ValidatorUtils.validateEntity(appuserloginverification);
        appUserLoginVerificationService.save(appuserloginverification);
        return R.ok();
    }

    @SysLog("修改AppUserLoginVerification")
    @PostMapping("/update")
    public R update(@RequestBody AppUserLoginVerification appuserloginverification) {
        ValidatorUtils.validateEntity(appuserloginverification);
        appUserLoginVerificationService.update(appuserloginverification);
        return R.ok();
    }

    @SysLog("删除AppUserLoginVerification")
    @PostMapping("/delete")
    public R delete(@RequestBody Long[] ids) {
        appUserLoginVerificationService.deleteBatch(ids);
        return R.ok();
    }
}